package api.my_api;

import java.time.LocalDateTime;
import java.time.Period;

public class Test10 {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime of = LocalDateTime.of(2023, 4, 15, 1, 1, 1);
        Period period = Period.between(now.toLocalDate(), of.toLocalDate());
        System.out.println("period = " + period);
        System.out.println("period.getYears() = " + period.getYears());
        System.out.println("period.getMonths() = " + period.getMonths());
        System.out.println("period.toTotalMonths() = " + period.toTotalMonths());
        System.out.println("period.getDays() = " + period.getDays());

    }
}
